package com.leyou.item.mapper;

import com.leyou.common.mapper.BaseMapper;
import com.leyou.item.entity.Sku;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.special.InsertListMapper;


public interface SkuMapper extends BaseMapper<Sku>, InsertListMapper<Sku> {

    @Update("Update tb_sku SET stock = stock - #{num} WHERE id = #{id}")
    int minusStock(
            @Param("id") Long skuId,
            @Param("num") Integer num
    );

}
